#pragma once
#include "AppConfig.h"
#include "RegisterAppInfo.h"

class AppContext
{
public:
	AppContext(void);
	~AppContext(void);
	BOOL GetDbPathName(char *dbPathName);
	BOOL GetDbPath(char *dbPath);
	BOOL GetSerialNum(char *serialNum);
	void SetExeInfo(char *rawExePathName, BOOL isMainExe);
	//BOOL GetInstallPath(char *installPath);
	//BOOL GetAppName(char *appName);
	void Backup();
	void Recover();
private:
	BOOL Init();
	char m_dbPathName[MAX_PATH];
	char m_dbPath[MAX_PATH];
	char m_serialNum[TAX_DEVICE_SERIAL_LENGTH];
	char m_installPath[MAX_PATH];
	char m_rawExePathName[MAX_PATH];
	BOOL m_isInited;
	AppConfig *m_config;
	BOOL m_isMainExe;
//	HMODULE m_hMod;
//	char m_appName[FAX_APP_NAME_LENGTH];
};

extern AppContext g_appContext;
typedef AppConfig *(*PFNCreateAppConfigObject)();

typedef BOOL (*PFNInitAppRegisterInfo)();

typedef RegisterAppInfo* (*PFNCreateRegisterAppInfoObject)();


typedef BOOL (*PFNGetAppRegisterInfoByExePath)( char *exePath, RegisterAppInfo &info );


typedef BOOL (*PFNGetConfigBySerialNum)(char *serialNum, AppConfig &config);
